(function(){
	chrome.runtime.sendMessage({
		type: 'completed',
        value: 'guide2'
    });

	var $submit = document.getElementById('submit'),
		$close = document.getElementById('close'),
		$form = document.getElementById('form');

    $close.addEventListener('click', function(e){
    	window.close();
    	e.stopPropagation();
	});
	document.body.addEventListener('contextmenu', function(e) {e.preventDefault(); return false;});

	$form.addEventListener('submit', function() {
		chrome.runtime.sendMessage({
			type: 'queryFromGuide2'
		});
	});
})();